#include <stdio.h>
int Fabnq1(int n)
{
	if (n > 2)
	{
		return Fabnq1(n - 1) + Fabnq1(n - 2);
	}
	else
		return 1;
}
int Fabnq2(int n)
{
	int a = 1;
	int b = 1;
	int c = 0;
	while (n-2)
	{
		c = a + b;
		a = b;
		b = c;
		n--;
	}
	return c;

}
int main()
{
	int num = 0;
	scanf_s("%d", &num);
	int ret1 = Fabnq1(num);
	int ret2 = Fabnq2(num);
	printf("%d\n", ret1);
	printf("%d\n", ret2);
	return 0;
}